<?php
/**
* PHP Template.
*/
$runValidation = false;
if(isset($this->validation)){
$runValidation = true;
}
$className="";
?>
<div id="content">
	<div class="col1">
		<div class="col-padding">
			&nbsp;
		</div>
	</div>
	<div class="col2">
		<div class="col-padding">
			<div class="container">
				<div class="container-padding">
					<?php if($this->phpsession->flashget("error")!=""): ?>
					<div class="error-box">
						<div class="container-padding">
							<p>
								<?= $this->phpsession->flashget("error") ?>
							</p>
						</div>
					</div>
					<?php endif; ?>
					<form id="handleCreate" action="/<?=$form_action?>" method="post">
						<div class="container">
							<div class="container-padding">
								<h2>Login Info</h2>
								<div class="line-h line-padding"></div>
								<div class="input-div">
									<label for="username"><span class="required">Username:</span></label>
									<?php if(isset($isUpdate) && $isUpdate){ ?>
									<input type="hidden" name="username" value="<?php if(isset($default_values["username"])) { echo $default_values["username"]; } ?>" id="username" />
									<strong><?php if(isset($default_values["username"])) { echo $default_values["username"]; } ?></strong>
									<?php } else { ?>
									<?php if($runValidation) { if($this->validation->username_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="username" class="<?=$className?>" value="<?php if(isset($default_values["username"])) { echo $default_values["username"]; } ?>" id="username" size="20" maxlength="20" />
									<?php } ?>
								</div>
								<div class="input-div">
									<label for="passwd"><span class="required">Password:</span></label>
									<?php if($runValidation) { if($this->validation->passwd_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="passwd" class="<?=$className?>" value="<?php if(isset($default_values["passwd"])) { echo $default_values["passwd"]; } ?>" id="passwd" size="20" maxlength="30" />
								</div>
								<div class="input-div">
									<label for="passwd2"><span class="required">Password:</span></label>
									<?php if($runValidation) { if($this->validation->passwd2_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="passwd2" class="<?=$className?>" value="<?php if(isset($default_values["passwd2"])) { echo $default_values["passwd2"]; } ?>" id="passwd2" size="20" maxlength="30" />
								</div>
							</div>
							<div class="container-padding">
								<h2>Personal Info</h2>
								<div class="line-h line-padding"></div>
								<div class="input-div">
									<label for="fname"><span class="required">First Name:</span></label>
									<?php if($runValidation) { if($this->validation->fname_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="fname" class="<?=$className?>" value="<?php if(isset($default_values["fname"])) { echo $default_values["fname"]; } ?>" id="fname" size="20" maxlength="20" />
								</div>
								<div class="input-div">
									<label for="passwd"><span class="required">Last Name:</span></label>
									<?php if($runValidation) { if($this->validation->lname_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="lname" class="<?=$className?>" value="<?php if(isset($default_values["lname"])) { echo $default_values["lname"]; } ?>" id="lname" size="20" maxlength="30" />
								</div>
								<div class="input-div">
									<label for="aha_number">AHA #:</label>
									<input type="text" name="aha_number" id="aha_number" size="20" maxlength="15" value="<?php if(isset($default_values["aha_number"])) { echo $default_values["aha_number"]; } ?>"/>
								</div>
							</div>
							<div class="container-padding">
								<h2>Contact Info</h2>
								<div class="line-h line-padding"></div>
								<div class="input-div">
									<label for="phone"><span class="required">Phone#:</span></label>
									<?php if($runValidation) { if($this->validation->phone_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="phone" class="<?=$className?>" value="<?php if(isset($default_values["phone"])) { echo $default_values["phone"]; } ?>" id="phone" size="10" maxlength="10" />
								</div>
								<div class="input-div">
									<label for="email"><span class="required">E-Mail:</span></label>
									<?php if($runValidation) { if($this->validation->email_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="email" class="<?=$className?>" value="<?php if(isset($default_values["email"])) { echo $default_values["email"]; } ?>" id="email" size="20" maxlength="40" />
								</div>
								<div class="input-div">
									<label for="cell">Cell#:</label>
									<input type="text" name="cell" id="cell" size="10" maxlength="10" value="<?php if(isset($default_values["cell"])) { echo $default_values["cell"]; } ?>" />
								</div>
								<div class="input-div">
									<label for="fax">Fax:</label>
									<input type="text" name="fax" id="fax" size="10" maxlength="10" value="<?php if(isset($default_values["fax"])) { echo $default_values["fax"]; } ?>"/>
								</div>
								<div class="input-div">
									<label for="best_time"><span class="required">Best Time to Contact:</span></label>
									<select name="best_time" id="best_time">
										<?php
										foreach($best_time->result() as $row): ?>
										<option value="<?=$row->best_time ?>" <?php if(isset($default_values["best_time"])&&$default_values["best_time"]==$row->best_time) { echo "selected=\"true\""; } ?>><?=$row->best_time?></option>
										<?php endforeach; ?>
									</select>
								</div>
								<div class="input-div">
									<label for="best_days"><span class="required">Best Days to Contact:</span></label>
									<select name="best_days" id="best_days">
										<?php
										foreach($best_days->result() as $row): ?>
										<option value="<?=$row->best_days ?>" <?php if(isset($default_values["best_days"])&&$default_values["best_days"]==$row->best_days) { echo "selected=\"true\""; } ?>><?=$row->best_days?></option>
										<?php endforeach; ?>
									</select>
								</div>
							</div>
							<div class="container-padding">
								<h2>Location Info</h2>
								<div class="line-h line-padding"></div>
								<div class="input-div">
									<label for="name"><span class="required">Location Name:</span></label>
									<?php if($runValidation) { if($this->validation->name_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<input type="text" name="name" class="<?=$className ?>" value="<?php if(isset($default_values["name"])) { echo $default_values["name"]; } ?>" id="name" size="30" maxlength="40" />
								</div>
								<div class="input-div">
									<label for="address1">Address 1:</label>
									<input type="text" name="address1" value="<?php if(isset($default_values["address1"])) { echo $default_values["address1"]; } ?>" id="address1" size="30" maxlength="40" />
								</div>
								<div class="input-div">
									<label for="address2">Address 2:</label>
									<input type="text" name="address2" value="<?php if(isset($default_values["address2"])) { echo $default_values["address2"]; } ?>" id="address2" size="30" maxlength="40" />
								</div>
								<div class="input-div">
									<label for="city">City:</label>
									<input type="text" name="city" id="city" size="10" maxlength="10" value="<?php if(isset($default_values["city"])) { echo $default_values["city"]; } ?>"/>
								</div>
								<div class="input-div">
									<label for="city">State:</label>
									<select name="state" id="state">
										<option value="">Select One</option>
										<?php
										foreach($state->result() as $row): ?>
										<option value="<?=$row->state_abbr ?>" <?php if(isset($default_values["state"]) && $default_values["state"]==$row->state_abbr) { echo "selected=\"true\""; } ?>><?=$row->state_abbr?></option>
										<?php endforeach; ?>
									</select>
								</div>
								<div class="input-div">
									<?php if($runValidation) { if($this->validation->zipcode_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<label for="zipcode"><span class="required">Postal Code:</span></label>
									<input type="text" name="zipcode" id="zipcode" class="<?=$className?>" size="5" maxlength="5" value="<?php if(isset($default_values["zipcode"])) { echo $default_values["zipcode"]; } ?>"/>
								</div>
								<div class="input-div">
									<?php if($runValidation) { if($this->validation->location_type_error!="") { $className="form-error"; } else { $className=""; } } ?>
									<label for="location_type"><span class="required">Location Type:</span></label>
									<select name="location_type" id="location_type" class="<?=$className?>">
										<option value="">Select One</option>
										<?php
										foreach($location_type->result() as $row) { ?>
										<option value="<?=$row->location_type ?>" <?php if(isset($default_values["location_type"]) && $default_values["location_type"]==$row->location_type) { echo "selected=\"true\""; } ?>><?=$row->location_type?></option>
										<?php } ?>
									</select>
								</div>
							</div>
							<div class="container-padding">
								<div class="input-div"><input type="submit" value="<?=$form_button?>" /></div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="col3">
		<div class="col-padding">
			&nbsp;
		</div>
	</div>
</div>